package org.xiaov.rabbitmq.fregin;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import org.xiaov.entity.po.UserPo;
import org.xiaov.framework.constant.ApiR;

/**
 * <p>
 * 描述：
 * </p>
 *
 * @author xiaovcloud
 * @since 2021/12/25 16:42
 */
@Component
@FeignClient("cloud-consumer")
@RequestMapping("/user")
public interface ConsumerClient {

    /**
     * 根据 id 获取用户
     *
     * @param id id
     * @return 用户
     */
    @GetMapping("/{id}")
    ApiR<UserPo> getUserById(@PathVariable("id") String id) ;

    /**
     * 根据 id 修改用户
     *
     * @param userPo 用户信息
     * @return ApiR<Boolean>
     */
    @PutMapping()
    ApiR<Boolean> edit(@RequestBody UserPo userPo);
}
